﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<iss.sg4210.se18.team6s.jass.DAL.Advertisement>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Edit
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h2>
        Edit</h2>
    <% using (Html.BeginForm(new AjaxOptions { }))
       {%>
    <%: Html.ValidationSummary(true) %>
    <fieldset>
        <legend>Fields</legend>
        <%:Html.HiddenFor(model=>model.Id) %>
        <div class="editor-label">
            <%: Html.LabelFor(model => model.Title) %>
        </div>
        <div class="editor-field">
            <%: Html.TextBoxFor(model => model.Title) %>
            <%: Html.ValidationMessageFor(model => model.Title) %>
        </div>
        <div class="editor-label">
            <%: Html.LabelFor(model => model.Description) %>
        </div>
        <div class="editor-field">
            <%: Html.TextBoxFor(model => model.Description) %>
            <%: Html.ValidationMessageFor(model => model.Description) %>
        </div>
        <div class="editor-label">
            <%: Html.LabelFor(model => model.ExperienceInYears) %>
        </div>
        <div class="editor-field">
            <%: Html.TextBoxFor(model => model.ExperienceInYears) %>
            <%: Html.ValidationMessageFor(model => model.ExperienceInYears) %>
        </div>
        <div class="editor-label">
            <%: Html.LabelFor(model => model.SalaryFrom) %>
        </div>
        <div class="editor-field">
            <%: Html.TextBoxFor(model => model.SalaryFrom) %>
            <%: Html.ValidationMessageFor(model => model.SalaryFrom) %>
        </div>
        <div class="editor-label">
            <%: Html.LabelFor(model => model.SalaryTo) %>
        </div>
        <div class="editor-field">
            <%: Html.TextBoxFor(model => model.SalaryTo) %>
            <%: Html.ValidationMessageFor(model => model.SalaryTo) %>
        </div>
        <div class="editor-label">
            <%: Html.LabelFor(model => model.StartDate) %>
        </div>
        <div class="editor-field">
            <%: Html.TextBoxFor(model => model.StartDate, String.Format("{0:g}", Model.StartDate)) %>
            <%: Html.ValidationMessageFor(model => model.StartDate) %>
        </div>
        <div class="editor-label">
            <%: Html.LabelFor(model => model.GeoAreaId) %>
        </div>
        <div id="GeoAreaList" class="editor-field">
        </div>
        <div class="editor-label">
            <%: Html.LabelFor(model => model.CompanyId)%>
        </div>
        <div id="CompanyList" class="editor-field">
        </div>
        <div class="editor-label">
            <%: Html.LabelFor(model => model.IsDeleted)%>
        </div>
        <div class="editor-field">
            <%: Html.EditorFor(model => model.IsDeleted, "Boolean")%>
            <%: Html.ValidationMessageFor(model => model.IsDeleted)%>
        </div>
        <div class="editor-label">
            <%: Html.LabelFor(model => model.IsWithDrawn)%>
        </div>
        <div class="editor-field">
            <%: Html.EditorFor(model => model.IsWithDrawn, "Boolean")%>
            <%: Html.ValidationMessageFor(model => model.IsWithDrawn)%>
        </div>
        <div class="editor-label">
            <%: Html.LabelFor(model => model.IsFulFilled)%>
        </div>
        <div class="editor-field">
            <%: Html.EditorFor(model => model.IsFulFilled, "Boolean")%>
            <%: Html.ValidationMessageFor(model => model.IsFulFilled)%>
        </div>
        <div class="editor-label">
            <%: Html.LabelFor(model => model.AdvertisementTypeId) %>
        </div>
        <div id="AdvertisementTypeList">
        </div>
        <p>
            <input type="submit" value="Save" />
        </p>
    </fieldset>
    <% } %>
    <div>
        <%: Html.ActionLink("Back to List", "Index") %>
    </div>
    <script type="text/javascript">
        $(document).ready(function () { $("#GeoAreaList").load("/Advertisement/AdvertisementsGeoAreaList/" + $("#Id").val()); });
        $(document).ready(function () { $("#CompanyList").load("/Advertisement/AdvertisementsCompanyList/" + $("#Id").val()); });
        $(document).ready(function () { $("#AdvertisementTypeList").load("/Advertisement/AdvertisementsAdvertisementTypeList/" + $("#Id").val()); });
        $(function () { $("#StartDate").datepicker({ altField: "#StartDate", altFormat: "DD,d MM, yy" }); });
    </script>
</asp:Content>
